﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string str="";
        string type = "";
        if(Request.QueryString["type"]!=null)
            type = Request.QueryString["type"].ToString().ToLower();    

        string Path = Request.PathInfo.ToString();
        if (Request.QueryString.ToString() != "")
        {
            str = Request.QueryString.ToString();
        }
        if (Request.Form.ToString() != "")
        {
            str = Request.Form.ToString();
        }
        string[] strArray = str.Split('&');
        for (int i = 0; i < strArray.Length-1; i++)
        {
            if (strArray[i].Contains("type"))
            {
                type = strArray[i].ToString();
                break;
            }
        }
        if (type.Contains("news"))
        {
            Server.Transfer("SearchNews.aspx?" + str, true);
        }
        else if (type.Contains("purchase"))
        {
            Server.Transfer("SearchPurchase.aspx?" + str, true);
        }
        else if (type.Contains("company"))
        {
            Server.Transfer("SearchCompany.aspx?" + str, true);
        }
        else if (type.Contains("expo"))
        {
            Server.Transfer("SearchExpo.aspx?" + str, true);
        }
        else {
            Server.Transfer("SearchSupply.aspx?" + str, true);
        }
    }

}
